<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box">
        <h1>{{msg}}</h1>
        <!-- 条件渲染 -->
        <h2 v-if="show">{{ok}}</h2>
        <!-- <h2 v-else-if="show">我考虑考虑</h2> -->
        <h2 v-else>{{no}}</h2>
        <!-- v-if v-else  都是真正意义上的销毁与重建 -->

        <h2 v-show="show">{{ok}}v-showtest</h2>
        <!-- v-show 显示与隐藏 通过改变display属性的变化实现的 -->
        <button @click="changeShow">改变结果</button>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        let vm1 = new Vue({
            el:'#box',
            data:{
                msg:'你嫁给我吧？',
                ok:'yes',
                no:'你是个好人...',
                show:false
            },
            methods: {
                changeShow(){
                    this.show = !this.show
                }
            },
        })
    </script>
</body>
</html>